<?php
/* @var $this SiteController */
/* @var $model ContactForm */
/* @var $form CActiveForm */

$this->pageTitle=Yii::app()->name . ' - Contact Us';
$this->breadcrumbs=array(
	'Contact',
);
?>

<?php if(Yii::app()->user->hasFlash('contact')): ?>

<div class="flash-success">
	<?php echo Yii::app()->user->getFlash('contact'); ?>
</div>

<?php else: ?>

<!-- Intro -->
<div class="container text-center">
	<br> <br>
	<h2 class="thin">如果对网站感兴趣，请留下联系方式</h2>
	<p class="text-muted">
        读书无嗜好，就能尽其多。不先泛览群书，则会无所适从或失之偏好，广然后深，博然后专。　——鲁迅
	</p>
</div>
<!-- /Intro-->
<div class="container">
<div class="form-horizontal col-sm-offset-3">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'contact-form',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
)); ?>

	<?php echo $form->errorSummary($model); ?>

	<div class="form-group">
		<?php echo $form->labelEx($model,'姓名*', array('class'=>'text-danger col-sm-1')); ?>
        <div class="col-sm-10">
		<?php echo $form->textField($model,'name', array('class'=>'form-control','style'=>'width:500px'))?>
        </div>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="form-group">
		<?php echo $form->labelEx($model,'邮箱*', array('class'=>'text-danger col-sm-1')); ?>
		<?php echo $form->textField($model,'email', array('class'=>'form-control','style'=>'width:500px')); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'主题内容*', array('class'=>'text-danger col-sm-1')); ?>
		<?php echo $form->textField($model,'subject',array('size'=>60,'maxlength'=>128,'class'=>'form-control','style'=>'width:500px')); ?>
		<?php echo $form->error($model,'subject'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'内容*', array('class'=>'text-danger col-sm-1')); ?>
		<?php echo $form->textArea($model,'body',array('rows'=>6, 'cols'=>50, 'class'=>'form-control','style'=>'width:500px')); ?>
		<?php echo $form->error($model,'body'); ?>
	</div>

	<?php if(CCaptcha::checkRequirements()): ?>
	<div class="row">
		<div>
             <?php $this->widget('CCaptcha',array(
                 'buttonLabel'=>'刷新验证码',
             ));?>
		<?php echo $form->textField($model,'verifyCode', array('class'=>'text-danger')); ?>
		</div>
		<?php echo $form->error($model,'verifyCode'); ?>
	</div>
	<?php endif; ?>

	<div class="row buttons col-sm-9">
		<?php echo CHtml::submitButton('Submit', array('class'=>'btn btn-action pull-right')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->

<?php endif; ?>
</div>
